<?php
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-03-10 23:49:19
 * @LastEditTime: 2022-03-11 00:01:17
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */
/*
 * @Author: CHINAKAIYUAN<sunkaiyuan@namenode.cn>
 * @Date: 2022-03-10 23:28:10
 * @LastEditTime: 2022-03-10 23:30:28
 * @LastEditors: CHINAKAIYUAN
 * @Description: 
 */

namespace App\Models;

use App\Traits\AutoCodeTrait;
use App\Traits\CommonUserTrait;
use App\Traits\MaterialTrait;
use Illuminate\Support\Facades\Storage;

class Barcode extends BaseModel
    {
    //
    use AutoCodeTrait;
    use MaterialTrait;
    use CommonUserTrait;
    public $timestamps = true;
    public $table = "basedata_barcode";
    protected $guarded = [];
    protected $appends = ['url'];

    /**
     * 标识
     *
     * @var string
     */
    protected $ACSign = 'BARCODE';
    public function getUrlAttribute()
        {
        return Storage::disk("barcode")->url($this->filepath);
        }
    //保证不保存没有的列URL
    public function setUrlAttribute($value)
        {
        return;
        }
    }
